
from page.base_page_helin import BasePage
from selenium.webdriver.common.by import By

class Addmesage(BasePage):
    # 进入添加短信模板页面，依次点击【更多】【营销】【发送短信】【设置】【添加短信模板】
    gd_locator=(By.XPATH,"/html/body/div[1]/div/div/div[2]/ul[1]/li[9]/a")
    yx_locator=(By.LINK_TEXT,"营销")
    fjx_locator=(By.LINK_TEXT,"发送短信")
    sz_locator=(By.LINK_TEXT,"设置")
    tjdxmb_locator=(By.LINK_TEXT,"添加短信模板")

    # 添加模板定位器
    mobt_locator=(By.NAME,"subject")
    mbnr_locator=(By.ID,"content")
    bc_locator=(By.CSS_SELECTOR,"input[value=保存]")

    # 进入添加短信模板页面
    def click_gd(self):
        self.driver.find_element(*self.gd_locator).click()

    def click_yx(self):
        self.driver.find_element(*self.yx_locator).click()

    def click_fjx(self):
        self.driver.find_element(*self.fjx_locator).click()

    def click_sz(self):
        self.driver.find_element(*self.sz_locator).click()

    def click_tjdxmb(self):
        self.driver.find_element(*self.tjdxmb_locator).click()

    # 添加模板
    def addmessage_mbbt(self,mbbt):
        self.driver.find_element(*self.mobt_locator).send_keys(mbbt)

    def addmessage_mbnr(self, mbnr):
        self.driver.find_element(*self.mbnr_locator).send_keys(mbnr)

    def addmessage_bcmb(self):
        self.driver.find_element(*self.bc_locator).click()



